//
//  QSRouterMacros.h
//  QSMusicPillow
//
//  Created by user on 2022/5/11.
//

#ifndef QSRouterMacros_h
#define QSRouterMacros_h

#ifndef QSRouterSectionName
#define QSRouterSectionName "QSRouter"
#endif

#define QSAnnotationDATA(sectname) __attribute((used, section("__DATA,"#sectname"")))

#define QSAddModule(modName) \
protocol QSLaunchModuleProtocol; \
char * kQSAddModule_##modName QSAnnotationDATA(QSRouter) = "M:"#modName"";

#define QSAddService(serviceName,cls) \
protocol QSLaunchServiceProtocol; \
char * kQSAddService_##serviceName QSAnnotationDATA(QSRouter) = "S:"#serviceName":"#cls"";

#define QSServiceInstance(ServiceProtocol, instanceName) \
id <ServiceProtocol> instanceName = [[QSRouter sharedInstance] findService:@protocol(ServiceProtocol)];

#endif /* QSRouterMacros_h */
